package com.example.rbac.controller.view;

import com.example.rbac.entity.Menu;
import com.example.rbac.service.MenuService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by Administrator on 2017/10/15.
 */
@Controller
@RequestMapping("Menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @RequiresPermissions("menu:view")
    @GetMapping("/ListView")
    public String ListView(){
        return "/Menu/MenuList";
    }

    @RequiresPermissions("menu:edit")
    @GetMapping("/MenuEdit")
    public String MenuAdd(String id, Model model){
        model.addAttribute("id", id);
        return "/Menu/MenuAdd";
    }

}
